<?php

//$host = "mail.systweak.net";
//$username = "kayakosupportserver@systweak.com";
//$password = "ec1n8nx9";
 
$host = "192.168.0.3";
$username = "webadmin@systweak.in";
$password = "web123";

require_once 'PHPMailerAutoload.php';

$mail = new PHPMailer;

$mail->isSMTP();                                      // Set mailer to use SMTP
$mail->Host = $host;  // Specify main and backup server
$mail->SMTPAuth = true;                               // Enable SMTP authentication
$mail->Username = $username;                            // SMTP username
$mail->Password = $password;                           // SMTP password
//$mail->SMTPSecure = 'ssl';                            // Enable encryption, 'ssl' also accepted

//$mail->From = "kayakosupportserver@systweak.com";
//$mail->FromName = 'The Phone Support';


$mail->From = "webadmin@systweak.in";
$mail->FromName = 'The Phone Support Web admin';
//$mail->isHTML(true);


//$mail->addAddress('jodhraj1087@gmail.com', 'Jodhraj Kumawat');

function sendphpmail($mailobj,$tomailid,$toname,$subject,$message)
{
    if(strpos($tomailid,",")>0)
    {
        $toidarr=explode(",",$tomailid);
        for($i=0;$i<count($toidarr);$i++)
        {
            $mailobj->addAddress($toidarr[$i], $toname);
        }
    }
    else
    {
        $mailobj->addAddress($tomailid, $toname);
    }
    $mailobj->Subject = $subject;
    $mailobj->Body    = $message;
    if($mailobj->send()) {
       return "success";
    }
    else
    {
        return 'Message could not be sent. Mailer Error: ' . $mailobj->ErrorInfo;
    }
}

?>